Skip to content

feat(diann): protein inference defaults to DIA-NN standard; relaxed/no-prot-inf opt-in - #107

Merged
ypriverol merged 11 commits into
devfrom
feat/configurable-final-prot-inf
Jun 10, 2026
Merged

ypriverol merged 11 commits into
devfrom
feat/configurable-final-prot-inf

Conversation

@ypriverol

@ypriverol ypriverol commented Jun 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Makes DIA-NN protein inference configurable and aligns the pipeline default with DIA-NN's documented default. Two mutually-exclusive, opt-in parameters (relaxed_prot_inf, no_prot_inf) now control protein inference on the report-producing second-pass steps; by default the pipeline passes no inference flag, i.e. DIA-NN's standard heuristic inference.

Why — the problem this fixes

Protein-inference flags were hardcoded and had drifted into an inconsistent state:

Step main (stable) dev (after #104)
INDIVIDUAL_ANALYSIS --relaxed-prot-inf --relaxed-prot-inf
FINAL_QUANTIFICATION --relaxed-prot-inf --no-prot-inf

main applied --relaxed-prot-inf to both second-pass steps; #104 switched only FINAL to --no-prot-inf and left INDIVIDUAL untouched. So dev now re-infers per file but reuses the library at the report step — and neither value is DIA-NN's default.

What DIA-NN actually documents

  • Default = heuristic protein inference, on by default — "the easiest way to analyse things for most experiments" (Discussion #680). It does maximum-parsimony (greedy set-cover) grouping.
  • --relaxed-prot-inf = FragPipe/Spectronaut-style grouping. DIA-NN's own example (#107): if X∈{A,B}, Y∈{B,C}, Z∈{A,C}, the default reports A;B/B;C/A;C, while relaxed reports A/C/C (each shared peptide assigned to one group).
  • --no-prot-inf = disable inference, keep the library's protein groups. Not in DIA-NN's documented defaults; it is the maintainer's benchmark-specific advice (reuse the empirical-library grouping at the second pass).
  • General guidance: "keep settings default, unless recommended otherwise for the specific scenario" (#316).

What this PR does

  • Adds two mutually-exclusive opt-in params (default false), applied to INDIVIDUAL_ANALYSIS + FINAL_QUANTIFICATION:
    • relaxed_prot_inf=true → --relaxed-prot-inf
    • no_prot_inf=true → --no-prot-inf
    • both false (default) → no flag → DIA-NN standard heuristic inference
  • Validates mutual exclusion at workflow start.
  • Replaces the hardcoded --relaxed-prot-inf (INDIVIDUAL) and --no-prot-inf (FINAL), fixing the main/dev inconsistency above.
  • PRELIMINARY_ANALYSIS keeps its own --no-prot-inf (mass-accuracy calibration pass — no inference; unaffected by the params). INSILICO_LIBRARY_GENERATION / ASSEMBLE_EMPIRICAL_LIBRARY do no inference.
  • BlockedFlags: --relaxed-prot-inf + --no-prot-inf blocked in every step where they'd conflict or have no effect, so they go through the params, not extra_args.
  • Docs (usage.md "Protein inference" section with DIA-NN's own examples), nextflow_schema.json, and CHANGELOG.md updated.

Resulting behaviour (per step)

Step 1.8.1 2.5.1
INSILICO_LIBRARY_GENERATION — —
PRELIMINARY_ANALYSIS --no-prot-inf (calibration) --no-prot-inf
ASSEMBLE_EMPIRICAL_LIBRARY — —
INDIVIDUAL_ANALYSIS (default: none) (default: none)
FINAL_QUANTIFICATION (default: none) (default: none)

Open decision for reviewers 👀

The default above follows DIA-NN's documented default (heuristic inference, no flag). There is a defensible alternative worth a maintainer call:

  • Keep DIA-NN standard (this PR's default) — matches DIA-NN docs; --no-prot-inf/--relaxed-prot-inf are opt-in for benchmarks.
  • Default to --no-prot-inf — reuse the empirical-library grouping at both second-pass steps (the maintainer's benchmark recommendation; this is the path where 1.8.1 vs 2.5 protein counts come out ~flat).

Flipping the default later is a one-line change (no_prot_inf default false → true). Feedback welcome on which should ship as the pipeline default.

Notes

  • Supersedes the earlier single relaxed_protein_inference toggle on this branch.
  • dev merged in; stale diann_extra_args (removed in favour of extra_args) cleaned up.

…in_inference)

FINAL_QUANTIFICATION hardcoded --no-prot-inf (#104). Make it a param:
relaxed_protein_inference=false (default) -> --no-prot-inf (reuse empirical-library
inference); true -> --relaxed-prot-inf (re-infer in final). Enables an A/B to test
whether --no-prot-inf is what lifts 1.8.1 protein counts and erases the 1.8.1->2.5
run-specific protein advantage Vadim expects (+12%/+18%).
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Jun 10, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4214e036-0262-4001-a573-3ed37ef04d38

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/configurable-final-prot-inf

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Jun 10, 2026 •

Copy link
Copy Markdown

nf-core pipelines lint overall result: Passed ✅ ⚠️

Posted for pipeline commit 39b0cb0

+| ✅ 108 tests passed       |+
#| ❔  18 tests were ignored |#
#| ❔   1 tests had warnings |#
!| ❗   4 tests had warnings |!
Details

❗ Test warnings:

  • files_exist - File not found: conf/igenomes.config
  • files_exist - File not found: conf/igenomes_ignored.config
  • files_exist - File not found: .github/workflows/awstest.yml
  • files_exist - File not found: .github/workflows/awsfulltest.yml

❔ Tests ignored:

❔ Tests fixed:

✅ Tests passed:

Run details

  • nf-core/tools version 4.0.2
  • Run at 2026-06-10 10:12:58

@ypriverol
ypriverol requested a review from yueqixuan June 10, 2026 06:33
…o-prot-inf opt-in

Per DIA-NN docs, --relaxed-prot-inf (FragPipe/Spectronaut-style grouping) and
--no-prot-inf (reuse library inference) are both OPT-IN deviations from DIA-NN's
default standard inference. The pipeline was forcing --relaxed-prot-inf
(INDIVIDUAL_ANALYSIS) and --no-prot-inf (FINAL, #104) -- both non-default.

Replace with two mutually-exclusive opt-in params (relaxed_prot_inf / no_prot_inf,
default false) applied to INDIVIDUAL_ANALYSIS + FINAL_QUANTIFICATION. Default (both
off) = DIA-NN standard inference -- what a typical user gets. Benchmarks opt into
whichever inference a given comparison needs (Vadim's guidance). Supersedes the
single relaxed_protein_inference toggle.
@ypriverol ypriverol changed the title feat(diann): make FINAL protein inference configurable (relaxed_protein_inference) feat(diann): protein inference defaults to DIA-NN standard; relaxed/no-prot-inf opt-in Jun 10, 2026
…rgs)

The dev merge conflict resolution wrongly kept diann_extra_args alongside
strip_unknown_mods. diann_extra_args was removed on dev in favor of extra_args
(7737952 'remove diann_ prefix', a2b8d48 'drop stale diann_extra_args references').
Remove it from nextflow.config + schema so the branch matches dev.
Remove --kb (preliminary/assemble/individual), QuantUMS (final), and protein-inference
(individual) inline comments — they duplicate the enable_kb / quantums / quantums_sel_runs /
relaxed_prot_inf / no_prot_inf parameter descriptions in nextflow.config + schema. Genuine
logic comments (toList gotcha, mass-accuracy version behaviour, validation guards) kept.
Address CodeRabbit review of #107: the usage.md flag table claimed --relaxed-prot-inf
is 'Always set' (now stale -- it's opt-in via relaxed_prot_inf, default = DIA-NN
standard inference), and the CHANGELOG only documented strip_unknown_mods. Update the
row and add a CHANGELOG entry for the new protein-inference params.
- usage.md: add a 'Protein inference' section — DIA-NN default is heuristic inference
  (no flag); relaxed_prot_inf/no_prot_inf are mutually-exclusive opt-ins on INDIVIDUAL +
  FINAL; PRELIMINARY is fixed --no-prot-inf (calibration); INSILICO/ASSEMBLE do none.
- BlockedFlags: refresh the INDIVIDUAL/FINAL comments (protein inference is now managed
  by the relaxed_prot_inf/no_prot_inf params, not hardcoded), and also block
  --relaxed-prot-inf in PRELIMINARY so extra_args can't add inference to the calibration pass.
…-liners

The detailed explanation lives in usage.md; keep the code comments terse.
Cite DIA-NN discussions: default = heuristic inference, on by default (#680);
--relaxed-prot-inf worked example A;B vs A (#107); 'keep defaults' guidance (#316).
Clarify that --no-prot-inf is a deliberate deviation, not a DIA-NN documented default.
Re-pad the GUI-flag table (widened by the relaxed-prot-inf row) and switch
emphasis to _italic_, per prettier@3.8.3 / .prettierrc.yml.
@ypriverol
ypriverol merged commit de98e98 into dev Jun 10, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant